/*
 * @lc app=leetcode.cn id=704 lang=golang
 *
 * [704] 二分查找
 */
package Solutions

import "sort"

// @lc code=start
func search__(nums []int, target int) int {
	i := sort.Search(len(nums), func(i int) bool {
		return nums[i] >= target
	})
	if i == len(nums) || nums[i] != target {
		return -1
	}
	return i
}

// @lc code=end
